package net.ojbk.study.twobox.service;

import net.ojbk.study.twobox.beans.po.Job;
import org.springframework.stereotype.Service;
import org.springframework.validation.BindingResult;

/**
 * Created with IntelliJ IDEA.
 * User: twobox
 * Date: 2019/4/18
 * Time: 10:58
 * Description: No Description
 */
@Service
public class JobService extends SupperService<Job> {
    @Override
    public void addOne(Job o, BindingResult br) throws Exception {
        this.validated(br, o.getClass());
        this.dao.insert(o);
    }

    @Override
    public void deleteOne(int id) throws Exception {
        this.dao.deleteByPrimaryKey(id);
    }

    @Override
    public void updateOne(Job o, BindingResult br) throws Exception {
        this.validated(br, o.getClass());
        this.dao.updateByPrimaryKeySelective(o);
    }
}
